package com.traval.util;

import org.hibernate.Session;
import org.hibernate.Transaction;

import com.traval.goods.models.TGoods;
import com.traval.orderANDcart.models.TCart;
import com.traval.user.models.TUser;

public class test_03 {

	public static void main(String[] args) {
		TUser user = new TUser();
		TCart cart = new TCart();
		
		user.setAddress("北京理工大学");
		user.setEmail("lyuio@126.com");
		user.setPassword("asd123");
		user.setRealname("lujinxiao");
		user.setTelephone("2423423");
		user.setType(1);
		user.setUsername("ps");

		cart.setPrice(123.4);
		cart.setTUser(user);
		user.setTCart(cart);
		
		Session session = HibernateSessionFactory.getSession();
		Transaction tx = session.beginTransaction();
		session.save(user);
		tx.commit();
		HibernateSessionFactory.closeSession();
	}

}
